
// 图片切换
var imgslist = ["./img/phone.png","./img/rolling-2.png","./img/rolling-3.png","./img/rolling-4.png","./img/rolling-5.png"];
var rollingslist = [rolling10,rolling20,rolling30,rolling40,rolling50];
var img10 = document.getElementById('img10');
var img11 = document.getElementById('img11');
// var rolling10 = document.getElementById('rolling10');


rollingslist[0].onmouseover = function(){
	img10.src = imgslist[0];
	img11.src = imgslist[0];
	i=0;
	$('.rolling1').css('border',' 0px solid #cb242b')		
	$('#rolling10').css('border','1px solid #cb242b ')
}
rollingslist[1].onmouseover = function(){
	img10.src = imgslist[1];
	img11.src = imgslist[1];
	i=1;
	$('.rolling1').css('border',' 0px solid #cb242b')	
	$('#rolling20').css('border','1px solid #cb242b ')
	
}
rollingslist[2].onmouseover = function(){
	img10.src = imgslist[2];
	img11.src = imgslist[2];
	i=2;
	$('.rolling1').css('border',' 0px solid #cb242b')
	$('#rolling30').css('border','1px solid #cb242b ')
}
rollingslist[3].onmouseover = function(){
	img10.src = imgslist[3];
	img11.src = imgslist[3];
	i=3;
	$('.rolling1').css('border',' 0px solid #cb242b')
	$('#rolling40').css('border','1px solid #cb242b ')
}
rollingslist[4].onmouseover = function(){
	img10.src = imgslist[4];
	img11.src = imgslist[4];
	i=4;
	$('.rolling1').css('border',' 0px solid #cb242b')	
	$('#rolling50').css('border','1px solid #cb242b ')
}

// 左右键
var onclicklist = [rollingslist[0].onmouseover,rollingslist[1].onmouseover,rollingslist[2].onmouseover,rollingslist[3].onmouseover,rollingslist[4].onmouseover]
var left2 = document.getElementById('left2');
var i = 0
right2.onclick = function(){
	i++;
	if(i>4){i = 0;}
	onclicklist[i]();
	
}
left2.onclick = function(){
	i--;
	if(i<0){i=4;}
	onclicklist[i]();
	
}


// right2.onclick = function(){

// }

// 购物车
var add =document.getElementById('add');
var minus =document.getElementById('minus');
var num =document.getElementById('num');
var cartnum = document.getElementById('cartnum');
var f18 = document.getElementById('fashion2list18');
add.onclick=function(){
    var a=num.value;
    a++;
    num.value=a;
}
minus.onclick=function(){
	var num=document.getElementById('num')
    var a=num.value;
    if(a>1){
    	a--;
    	num.value=a;
    }
}
f18.onclick = function(){
	cartnum.value = Number(num.value) + Number(cartnum.value);
}












